Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw TypeError if regexp is passed to startsWith, endsWith, includes #782

Merged
merged 1 commit into from
Oct 3, 2020
Merged

Throw TypeError if regexp is passed to startsWith, endsWith, includes #782

merged 1 commit into from
Oct 3, 2020

Conversation

pt2121
Copy link
Contributor

@pt2121 pt2121 commented Oct 3, 2020

This Pull Request fixes/closes #755.

It changes the following:

  • Updating startsWith, endsWith, includes to throw TypeError if regex is passed in.
  • Adding tests.

@codecov
Copy link

codecov bot commented Oct 3, 2020

Codecov Report

Merging #782 into master will increase coverage by 0.13%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #782      +/-   ##
==========================================
+ Coverage   59.28%   59.42%   +0.13%     
==========================================
  Files         156      156              
  Lines        9820     9830      +10     
==========================================
+ Hits         5822     5841      +19     
+ Misses       3998     3989       -9     
Impacted Files Coverage Δ
boa/src/builtins/string/mod.rs 59.03% <87.50%> (+2.49%) ⬆️
boa/src/object/mod.rs 28.57% <0.00%> (+1.14%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e60d2c...bbc8657. Read the comment docs.

boa/src/builtins/string/mod.rs Outdated Show resolved Hide resolved
boa/src/builtins/string/mod.rs Outdated Show resolved Hide resolved
@HalidOdat HalidOdat added bug Something isn't working builtins PRs and Issues related to builtins/intrinsics labels Oct 3, 2020
@HalidOdat HalidOdat added this to the v0.11.0 milestone Oct 3, 2020
@RageKnify RageKnify changed the title Throw TypeError if regex is passed to startsWith, endsWith, includes Throw TypeError if regexp is passed to startsWith, endsWith, includes Oct 3, 2020
@RageKnify RageKnify merged commit aad860d into boa-dev:master Oct 3, 2020
@pt2121 pt2121 deleted the pt/TypeError-755 branch October 3, 2020 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Throw TypeError if regex is passed to String.prototype.startsWith
3 participants